package com.rongshu.view.penpal.activity;

import android.content.Intent;
import android.support.v4.content.ContextCompat;
import android.widget.RelativeLayout;

import com.rongshu.R;
import com.rongshu.utils.Constant;
import com.rongshu.view.base.BaseActivity;
import com.rongshu.view.penpal.adapter.PenpalArticleManagerTypePageAdapter;
import com.rongshu.widget.TabPageIndicator;
import com.widget.NoScrollViewPager;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * created by zhengweis on 2018/11/6.
 * description：帖子管理
 */
public class NoteManagerActivity extends BaseActivity {

    @BindView(R.id.head_left)
    RelativeLayout headLeft;
    @BindView(R.id.indicator)
    TabPageIndicator indicator;
    @BindView(R.id.viewPager)
    NoScrollViewPager viewPager;
    private PenpalArticleManagerTypePageAdapter adapter;
    private int penpalwill_id = 0;

    @Override
    protected int initLayout() {
        return R.layout.activity_note_manager;
    }

    @Override
    protected void initView() {
        Intent intent = getIntent();
        penpalwill_id = intent.getIntExtra(Constant.PENPAL_ID, 0);
        initViewPager();
    }

    private void initViewPager() {
        adapter = new PenpalArticleManagerTypePageAdapter(getSupportFragmentManager(), penpalwill_id);
        viewPager.setAdapter(adapter);
        viewPager.setNoScroll(true);
        indicator.setViewPager(viewPager);
        indicator.setIndicatorMode(TabPageIndicator.IndicatorMode.MODE_WEIGHT_NOEXPAND_SAME);// 设置模式，一定要先设置模式
        indicator.setIndicatorColor(ContextCompat.getColor(this, R.color.color_3CC051));// 设置底部导航线的颜色
        indicator.setTextColor(ContextCompat.getColor(this, R.color.color_2c2c2c));
        indicator.setTextColorSelected(ContextCompat.getColor(this, R.color.color_3CC051));// 设置tab标题选中的颜色
        indicator.setTextSize((int) this.getResources().getDimension(R.dimen.dd_dimen_30px));// 设置字体大小
        indicator.setScrollOffset(2);
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void updateViews(boolean isRefresh) {

    }


    @OnClick(R.id.head_left)
    public void onViewClicked() {
        finish();
    }
}
